#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
void preorder(char* a, int root)
{
	if (a[root] == 0||a[root]=='#')
		return;
	else
		printf("%c", a[root]);
	preorder(a, root * 2 + 1);
	preorder(a, root * 2 + 2);
}
int main()
{
	char arr[100] = { 0 };
	int count = 0;
	scanf("%s", arr);
	preorder(arr, 0);
}